from time import *

def buble_sort(nums):
    swap=True
    while swap:
        swap=False
        for i in range(len(nums)-1):
            if nums[i]>nums[i+1]:
                nums[i],nums[i+1]=nums[i+1],nums[i]
                swap=True
                



with open("m1_sorted.txt") as f:
    s=f.readlines()
a=[int(i) for i in s if i!="\n"]
with open("m2_reverse.txt") as n:
    e=n.readlines()
c=[int(i) for i in e if i!="\n"]
with open("m3_shuffle.txt") as u:
    d=u.readlines()
k=[int(i) for i in d if i!="\n"]

st=time()
buble_sort(a)
end=time()
print("m1_sorted",round((end-st)*1000),"milliseconds")

st=time()
buble_sort(c)
end=time()
print("m2_reverse",round((end-st)*1000),"milliseconds")

st=time()
buble_sort(k)
end=time()
print("m3_shuffle",round((end-st)*1000),"milliseconds")

